
const data = { 
    name: 'Jack',
    age: 24
}

const proxyData = new Proxy(data, {
    get(target, key, receiver) {
        const result = Reflect.get(target, key, receiver)
        console.log('get', key)
        return result
    },
    set(target, key, val, receiver) {
        const result = Reflect.set(target, key, val, receiver)
        console.log('set', key, val)
        return result
    },
    deleteProperty(target, key) {
        const result = Reflect.deleteProperty(target, key)
        console.log('delete', key)
        return result
    }
})

console.log(data.name)
proxyData.name
proxyData.name = 'Lucy'
console.log(proxyData)
delete proxyData.age
console.log(proxyData)

